Repository navigation
Check a pgtest server address before the tests use it - #71
Conversation
…ost and query checks
…g in the changelog
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established. The PostgreSQL 18 test run remains to be completed as part of normal validation. Pre-merge checks |
|
There was a problem hiding this comment.
Code Health Improved
(3 files improve in Code Health)
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| new.go | 9.39 → 10.00 | Complex Method, Complex Conditional |
| swept_test.go | 9.39 → 10.00 | Complex Conditional |
| classify_test.go | 9.69 → 10.00 | Complex Method |
Quality Gate Profile: Clean Code Collective
Install CodeScene MCP: safeguard and uplift AI-generated code. Catch issues early with our IDE extension and CLI tool.
|
Closes #70
Closes #67
What
pgtest.CheckAddressreturns the errorNewwould stop a test with. It covers every addressNewrefuses,postgres.CheckAddressincluded. Each error matchesdbkit.ErrAddressand never repeats the address.pool_max_connsin the server address or its service file. pgtestdb would send it to the server.NewSweptchecks the address before it sweeps, so a refused address never connects.Classifynow classes it asdbkit.ErrForeignKey.Why
Downstream applications read their test server address from a setting of their own. A wrong address should stop the tests with a message that names that setting. A
pool_key used to fail later with a server error.NewSweptalso connected and swept before it refused an address. dbkit/sqlite already classes a RESTRICT stop as a foreign key failure.Testing Instructions
Run the testing toolchain in
dbkit/postgresagainst a PostgreSQL 18 server.Summary by CodeRabbit
RESTRICTconstraint violations are now classified as foreign-key errors.